import request from '@/utils/request'

export function sendComment(data) {
    return request({
        url: '/comment',
        method: 'post',
        data: data
    })
}

export function getCommentData(postId) {
    return request({
        url: '/comment?postId=' + postId,
        method: 'get',
    })
}

export function getLikeCommentData(userId, postId) {
    return request({
        url: '/comment/get/likes?userId=' + userId + '&postId=' + postId,
        method: 'get',
    })
}

export function likeComment(userId, id) {
    return request({
        url: '/comment/like?userId=' + userId + '&id=' + id,
        method: 'post',
    })
}

export function cancelLikeComment(userId, id) {
    return request({
        url: '/comment/cancel/like?userId=' + userId + '&id=' + id,
        method: 'post',
    })
}

export function deleteComment(ids) {
    return request({
        url: '/comment',
        method: 'delete',
        data: ids
    })
}